package touhou.base;

import java.awt.geom.Point2D;

import touhou.base.SpeedVector;

public class SpeedVectorDoubleImpl implements SpeedVector {

	private static final int DEFAULT_SPEED = 8;
	private Point2D direction;
	private int speed;

	public static SpeedVector createNullVector() {
		return new SpeedVectorDoubleImpl(new Point2D.Double(0, 0), 0);
	}

	public SpeedVectorDoubleImpl(Point2D direction, int speed) {
		this.direction = direction;
		this.speed = speed;
	}

	public SpeedVectorDoubleImpl(Point2D direction) {
		this(direction, DEFAULT_SPEED);
	}

	public Point2D getDirection() {
		return direction;
	}

	public int getSpeed() {
		return speed;
	}

	public void setDirection(Point2D direction) {
		this.direction = direction;
	}

	public void setSpeed(int speed) {
		this.speed = speed;
	}

	@Override
	public Object clone() {
		return new SpeedVectorDoubleImpl(direction, speed);
	}
}
